package cn.ac.jaas.ljx.mybatis.model;

public class PhoneNumber {

    private String perfix;
    private String suffix;
    
    public PhoneNumber(String perfix, String suffix) {
        this.perfix = perfix;
        this.suffix = suffix;
    }

    public PhoneNumber(String phoneNumber) {
        if(phoneNumber != null && phoneNumber.length() > 0) {
            String[] parts = phoneNumber.split("-");
            this.perfix = parts[0];
            this.suffix = parts[1];
        }
    }
    
    @Override
    public String toString() {
        return perfix + "-" + suffix;
    }

    public String getPerfix() {
        return perfix;
    }

    public void setPerfix(String perfix) {
        this.perfix = perfix;
    }

    public String getSuffix() {
        return suffix;
    }

    public void setSuffix(String suffix) {
        this.suffix = suffix;
    }
    
}
